﻿using System;

namespace Nb.Common.Domains.Models
{
    public interface INbEntityId
    {
        string Id { get; }
    }

    public abstract class NbEntityId : NbValueObject<NbEntityId>, INbEntityId
    {
        protected NbEntityId()
        {
            this.Id = Guid.NewGuid().ToString();
        }

        protected NbEntityId(string id)
        {
            this.Id = id;
        }

        public string Id { get; protected set; }
        public override string ToString()
        {
            return this.GetType().Name + " [Id=" + Id + "]";
        }
    }
}